package com.customer;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

/**
 * @author kxk
 * @version 1.0
 * @ClassName: CustomerApplicationStart
 * @Description: TODO 启动类
 * @Date: 2021-05-07 17:01
 */

@SpringBootApplication
@MapperScan("com.customer.dao")
public class CustomerApplicationStart {
    public static void main(String[] args) {
        SpringApplication.run(CustomerApplicationStart.class,args);

    }
    //这个bean的注册,用于扫描带有@ServerEndpoint的注解成为websocket  ,如果你使用外置的tomcat就不需要该配置文件
    @EnableWebSocket
    public class WebSocketConfiguration {
        @Bean
        public ServerEndpointExporter serverEndpointExporter() {
            return new ServerEndpointExporter();
        }
    }

}
